package main

import "fmt"

func main() {
	//如果我们想在map对象中存放一系列的属性的时候，我们就可以把map类型的值定义成切片

	//var userinfo = make(map[string]string)
	//userinfo["username"] = "张三"
	//userinfo["hobby"] = "睡觉"
	//fmt.Println(userinfo)

	var userinfo = make(map[string][]string)
	userinfo["hobby"] = []string{
		"吃饭",
		"睡觉",
		"打豆豆",
	}

	userinfo["work"] = []string{
		"php",
		"golang",
		"前端",
	}

	//fmt.Println(userinfo) //map[hobby:[吃饭 睡觉 打豆豆]]
	for t, v := range userinfo {
		fmt.Println("-----", t)
		for _, l := range v {
			fmt.Printf("%v\n", l)
		}
	}

	//var userinfo = map[string][]string{
	//	"hobby": []string{"吃饭", "睡觉", "打豆豆"},
	//}

	//fmt.Println(userinfo) //map[hobby:[吃饭 睡觉 打豆豆]]

}
